package gptma.bo.model.task;

import gptma.bo.model.BaseEntity;
import gptma.bo.model.employee.Employee;

import java.util.Date;

import javax.persistence.AttributeOverride;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@Entity
@Table(name = "affectation")
@AttributeOverride(name = "id", column = @Column(name = "affectationId"))
public class Assignment extends BaseEntity {

	private static final long serialVersionUID = 7958471705098275178L;

	@Temporal(value = TemporalType.TIMESTAMP)
	@Column(name = "dateCreation")
	private Date creationDate;

	@Column(name = "priorite")
	private Integer priority;

	@ManyToOne
	@JoinColumn(name = "tacheId")
	private Task task;

	@ManyToOne
	@JoinColumn(name = "collaborateurId")
	private Employee employee;

	/**
	 * @return the creationDate
	 */
	public Date getCreationDate() {
		return creationDate;
	}

	/**
	 * @param creationDate
	 *            the creationDate to set
	 */
	public void setCreationDate(Date creationDate) {
		this.creationDate = creationDate;
	}

	/**
	 * @return the priority
	 */
	public Integer getPriority() {
		return priority;
	}

	/**
	 * @param priority
	 *            the priority to set
	 */
	public void setPriority(Integer priority) {
		this.priority = priority;
	}

	/**
	 * @return the task
	 */
	public Task getTask() {
		return task;
	}

	/**
	 * @param task
	 *            the task to set
	 */
	public void setTask(Task task) {
		this.task = task;
	}

	/**
	 * @return the employee
	 */
	public Employee getEmployee() {
		return employee;
	}

	/**
	 * @param employee
	 *            the employee to set
	 */
	public void setEmployee(Employee employee) {
		this.employee = employee;
	}

}
